package com.chixing.day10_hashcode_exception;

public class StringDemo {
    public static void main(String[] args) {
        //字符串内容经常发生改变,在内存中有大量临时的String对象
        //占用空间，导致效率低
        //String适用于字符串内容不经常发生改变
        String word = "file";
        word = word +"run";
        word = word.toUpperCase();

        /**
         *
         */
        StringBuilder stringBuilder1 = new StringBuilder();
        stringBuilder1.append("hello");
        stringBuilder1.append("initial");
        stringBuilder1.append("Constructs a string builder with");
        String str  = stringBuilder1.toString();
        System.out.println(str);

        stringBuilder1.delete(0,2);
        stringBuilder1.insert(3,"是a");
        System.out.println(stringBuilder1.toString());




        StringBuilder stringBuilder2 = new StringBuilder("hello");

    }
}
